package com.tedu.day01.oop;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JPanel;

public class rishiJPanel extends JPanel{
	int x=700;
	public void startRun(){
		new Thread(){
			public void run(){
				while(true){
					for(int i=0;i<1024;i++){
						x++;
						if(x>1024){
							x=0;	}
}
					try{
						Thread.sleep(10);
					}catch(InterruptedException e){
						e.printStackTrace();
					}
					repaint();
				}
			}
		}.start();
	}
          public void paint(Graphics g){
        	  super.paint(g);
        	  this.setBackground(Color.BLACK);
        	  g.setColor(Color.YELLOW);
        	  g.fillArc(500, 100, 200, 200, 0,360);
        	  g.setColor(Color.BLACK);
        	  g.fillArc(x, 100, 200, 200, 0, 360);
      }
}